Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHIROS-1326 Kruize 0.0.20.1_rm Integration #129

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

saltgen
Copy link
Contributor

@saltgen saltgen commented Sep 22, 2023

Changes

  • listRecommendation payload struct changes
  • Send cluster name in create experiment payload; Cluster name for Kruize experiment should be org_id;cluster_uuid
  • Modify TransformComponentUnits util function as per new json structure
  • Modify TransformComponentUnits to add k8s supported units; reference
  • Update openapi file; coherent recomm. values and new json structure
  • Check for recommendation data object before saving (Is_valid_recommendation)
  • Check if recommendation is for requested maxEndTime

Sample Recommendation JSON

 {
      "cluster_name": "cluster-one-division-bell",
      "kubernetes_objects": [
        {
          "type": "deployment",
          "name": "tfb-qrh-deployment_0",
          "namespace": "default_0",
          "containers": [
            {
              "container_image_name": "kruize/tfb-qrh:1.13.2.F_et17",
              "container_name": "tfb-server-1",
              "recommendations": {
                "version": "1.0",
                "notifications": { #Level 1
                  "111000": {
                    "type": "info",
                    "message": "Recommendations Are Available",
                    "code": 111000
                  } 
                },
                "data": {
                  "2023-04-02T13:30:00.680Z": {
                    "notifications": { #Level 2
                      "111101": {
                        "type": "info",
                        "message": "Short Term Recommendations Available",
                        "code": 111101
                      }
                    },
                    "monitoring_end_time": "2023-04-02T13:30:00.680Z",
                    "current": {
                      "limits": {
                        "memory": {
                          "amount": 100.0,
                          "format": "MiB"
                        },
                        "cpu": {
                          "amount": 0.5,
                          "format": "cores"
                        }
                      },
                      "requests": {
                        "memory": {
                          "amount": 50.21,
                          "format": "MiB"
                        },
                        "cpu": {
                          "amount": 5.37,
                          "format": "cores"
                        }
                      }
                    },
                    "recommendation_terms": {
                      "short_term": {
                        "duration_in_hours": 24.0,
                        "notifications": {  #Level 3
                          "112101": {
                            "type": "info",
                            "message": "Cost Recommendations Available",
                            "code": 112101
                          },
                          "112102": {
                            "type": "info",
                            "message": "Performance Recommendations Available",
                            "code": 112102
                          }
                        },
                        "monitoring_start_time": "2023-04-01T12:00:00.000Z",
                        "recommendation_engines": {
                          "cost": {
                            "pods_count": 27,
                            "confidence_level": 0.0,
                            "config": {
                              "limits": {
                                "memory": {
                                  "amount": 238.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": 0.9299999999999999,
                                  "format": "cores"
                                }
                              },
                              "requests": {
                                "memory": {
                                  "amount": 238.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": 0.9299999999999999,
                                  "format": "cores"
                                }
                              }
                            },
                            "variation": {
                              "limits": {
                                "memory": {
                                  "amount": 138.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": -4.44,
                                  "format": "cores"
                                }
                              },
                              "requests": {
                                "memory": {
                                  "amount": 187.98999999999998,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": -4.44,
                                  "format": "cores"
                                }
                              }
                            },
                            "notifications": {} #Level 4
                          },
                          "performance": {
                            "pods_count": 27,
                            "confidence_level": 0.0,
                            "config": {
                              "limits": {
                                "memory": {
                                  "amount": 238.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": 0.9299999999999999,
                                  "format": "cores"
                                }
                              },
                              "requests": {
                                "memory": {
                                  "amount": 238.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": 0.9299999999999999,
                                  "format": "cores"
                                }
                              }
                            },
                            "variation": {
                              "limits": {
                                "memory": {
                                  "amount": 138.2,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": -4.44,
                                  "format": "cores"
                                }
                              },
                              "requests": {
                                "memory": {
                                  "amount": 187.98999999999998,
                                  "format": "MiB"
                                },
                                "cpu": {
                                  "amount": -4.44,
                                  "format": "cores"
                                }
                              }
                            },
                            "notifications": {}
                          }
                        }
                      },
                      "medium_term": {
                        "duration_in_hours": 34.0,
                        "notifications": {
                          "120001": {
                            "type": "info",
                            "message": "There is not enough data available to generate a recommendation.",
                            "code": 120001
                          }
                        }
                      },
                      "long_term": {
                        "duration_in_hours": 34.0,
                        "notifications": {
                          "120001": {
                            "type": "info",
                            "message": "There is not enough data available to generate a recommendation.",
                            "code": 120001
                          }
                        }
                      }
                    }
                  }
                }
              }
            }

@saltgen saltgen marked this pull request as draft September 22, 2023 15:42
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch 2 times, most recently from ac03e82 to 01b75a8 Compare September 28, 2023 14:18
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch from 01b75a8 to 8e53cd2 Compare October 6, 2023 11:08
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch 2 times, most recently from 9ccbb78 to c66601d Compare November 13, 2023 11:35
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch from c66601d to 752adf2 Compare November 21, 2023 13:08
@saltgen saltgen marked this pull request as ready for review November 21, 2023 13:11
@saltgen saltgen changed the title RHIROS-1326 Kruize 0.0.20_rm Integration RHIROS-1326 Kruize 0.0.20.1_rm Integration Dec 4, 2023
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch 2 times, most recently from 172b403 to eb62aec Compare December 4, 2023 18:00
@yash2189
Copy link
Contributor

/retest

Copy link
Contributor

@upadhyeammit upadhyeammit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added some observations, request to check.

internal/api/utils.go Show resolved Hide resolved
internal/api/utils.go Show resolved Hide resolved
internal/api/utils.go Outdated Show resolved Hide resolved
internal/api/utils.go Show resolved Hide resolved
internal/api/utils.go Outdated Show resolved Hide resolved
internal/types/kruizePayload/common.go Show resolved Hide resolved
internal/utils/kruize/kruize_api.go Outdated Show resolved Hide resolved
@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch from eb62aec to d81642b Compare December 13, 2023 10:14
@yash2189
Copy link
Contributor

/retest

return false
}
LogKruizeErrors(recommendationData, formattedMaxEndTime, experiment_name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is discussed internally with the Kruize team regarding not having these error logs on ROS side then we can remove this. Apart from it everything looks good to me 👍
I have tested PR locally and working as expected.

@saltgen
Copy link
Contributor Author

saltgen commented Dec 19, 2023

Thanks @upadhyeammit and @patilsuraj767, all changes pushed on a separate commit

@patilsuraj767
Copy link
Collaborator

/retest

1 similar comment
@patilsuraj767
Copy link
Collaborator

/retest

@kgaikwad
Copy link
Collaborator

kgaikwad commented Jan 2, 2024

As PR is approved by two reviewers, removed ready for review label and added ready for QE for visibility. Thanks!

@yash2189
Copy link
Contributor

/retest

@saltgen saltgen force-pushed the feature/kruize-19_rm-upgrade branch from b1c7f51 to 1bee2e5 Compare January 23, 2024 13:17
@@ -2,5 +2,4 @@ report_period_start,report_period_end,interval_start,interval_end,container_name
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-03 23:45:01 +0000 UTC,2023-06-04 00:00:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-04 00:00:01 +0000 UTC,2023-06-04 00:15:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-04 00:15:01 +0000 UTC,2023-06-04 00:30:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-04 00:30:01 +0000 UTC,2023-06-04 00:45:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-04 00:30:01 +0000 UTC,2023-06-04 00:45:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
2023-02-01 00:00:00 +0000 UTC,2023-03-01 00:00:00 +0000 UTC,2023-06-04 00:30:01 +0000 UTC,2023-06-04 00:45:00 +0000 UTC,Yuptoo-service,Yuptoo-app-standalone-1,Yuptoo-app,ReplicaSet,<none>,deployment,Yuptoo-prod,quay.io/cloudservices/yuptoo,ip-10-0-176-227.us-east-2.compute.internal,i-0dfbb3fa4d0e8fc94,1,1,1,1,0.047932,0.031571,0.064131,0.047932,0,0,0,1073741824,1073741824,1073741824,1073741824,513587266.064516,510009344,513900544,513587266.064516,493311537.548387,493293568,493371392,493311537.548387
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate row removed

@saltgen saltgen merged commit 5cf4a0e into RedHatInsights:main Jan 30, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants